import csv,json

rets = []
with open("all_subject.csv","rt")as f:
    reader = csv.reader(f)
    for row in reader:
        rets.append([row[0].replace(".txt",""),(int(row[1])-int(row[2]))/(int(row[1])+int(row[2])+int(row[3]))])

rets.sort(key=lambda x:x[1])
# print(rets)
# for line in rets:
#     print(line)

print(json.dumps(rets))